import Vue from 'vue'
import App from './App.vue'
import router from './router/index';
import TypeNav from './components/TypeNav';
import Carousel from './components/Carousel';
import Pagination from './components/Pagination';
import store from '@/store';
import '@/mock/mockServe';
import 'swiper/css/swiper.css';
import * as API from '@/api';
//引入elementUI
import { MessageBox } from 'element-ui';
//引入表单校验插件
import '@/plugins/validate';


Vue.config.productionTip = false
Vue.component(TypeNav.name, TypeNav);
Vue.component(Carousel.name, Carousel);
Vue.component(Pagination.name, Pagination);
//使用elementUI
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

new Vue({
  render: h => h(App),
  //全局事件总线
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  store
}).$mount('#app')
